// -----------------------------------------------------------------------------
// DM 是 .NET 5 平台下开发管理的系统。
// Copyright © 2021 DM, 虫儿飞科技 Co.,Ltd.
//
// 框架名称：Furion
// 框架版本：1.0.0
// -----------------------------------------------------------------------------

using AdminAuthority.Attributes;

using Abc.Application.Api.Developer.Dto;

using Furion.DynamicApiController;
using Furion.FriendlyException;

using Microsoft.AspNetCore.Mvc;

namespace Abc.Application.Api.Developer
{
    // [Injection(Proxy = typeof(LogDispatchProxy))]
    //[ApiActionFilter]
    //[ServiceFilter(typeof(ApiActionFilterAttribute))]
    //[WebActionFilter]
    [Area("api")]
    [AuthorityController(typeCode: "API", controllerDescription: "开发")]
    public class DeveloperService : IDynamicApiController
    {
        [AuthorityPermission(name: "测试", actions: "Test")]
        public string Test(TestDto input)
        {
            return $"输入的是：{input.Name}";
        }

        [AuthorityPermission(name: "测试2", actions: "Test2")]
        public string Test2(string a)
        {
            throw Oops.Oh(errorMessage: "111111111111133333333");
            return $"输入的是：{a}";
        }

        [HttpGet]
        public string abc()
        {
            return "a";
        }

        [HttpPut]
        public void Aa(string a)
        {
        }
    }
}